/*
 *  animation_manager.cc
 *  wonderland-project
 *
 *  Created by Ben Nolan on 20/10/08.
 *  Copyright 2008 Nolan Consulting Limited. All rights reserved.
 *
 */

#include "animation_manager.h"
#include <OgreAnimationState.h>
#include <boost/foreach.hpp>

namespace Wonderland{

  AnimationManager::AnimationManager(Ogre::SceneManager *scene_manager){
    scene_manager_ = scene_manager;
  }

  bool AnimationManager::frameStarted(const Ogre::FrameEvent &evt) {
      BOOST_FOREACH(Ogre::AnimationState *animation, animations_){
        animation->addTime(evt.timeSinceLastFrame);
      }
      
      return true;
  }
    
  void AnimationManager::addAnimation(Ogre::AnimationState *a){
    animations_.push_front(a);
  }
  
  void AnimationManager::removeAnimation(Ogre::AnimationState *a){
    // not implemented
    throw "Not implemented";
  }

}